import axios from "axios"
export default {
    namespaced: true,
    state: {
        hotFilms: [],
        reyingActive: "reying",
        contentActive: "movies"
    },
    mutations: {
        getHotFilmsData(state, hotFilmsData) {
            state.hotFilms = hotFilmsData.data.hot
        }

    },
    actions: {
        getHotFilmsData({
            commit
        },data) {
            axios({
                method: "get",
                url: `/mmdb/movie/v2/list/hot.json?limit=${data.lit?data.lit:12}&offset=0&ct=${data.ct?data.ct:'广州'}`
            }).then((res) => {
                commit("getHotFilmsData", res.data)
            })
        }
    }
}